<?php
/*
 * @Author: 李志刚
 * @CopyRight: 2020-2030 衡水山木枝技术服务有限公司
 * @Date: 2018-01-25 16:14:02
 * @Description: 砍价订单，发起砍价的记录
 * @LastEditors: 李志刚
 * @LastEditTime: 2021-10-20 10:31:11
 * @FilePath: /qingshanERP/database/migrations/b2b/expand/2018_01_25_160944_create_bargain_orders.php
 */

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateBargainOrders extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('bargain_orders', function (Blueprint $table) {
            $table->engine = 'InnoDB';
            $table->id();
            $table->foreignId('shop_id')->default(0)->comment('门店ID');
            $table->foreignId('user_id')->default(0)->comment('发起用户ID');
            $table->foreignId('bargin_id')->default(0)->comment('活动ID');
            $table->string('bargin_title',255)->default('')->comment('活动标题');
            $table->foreignId('good_id')->default(0)->comment('商品ID');
            $table->decimal('old_price',10,2)->default(0)->comment('原价价格');
            $table->decimal('price',10,2)->default(0)->comment('现在价格');
            $table->integer('nums')->default(0)->comment('已砍多少次');
            $table->integer('maxnum')->default(0)->comment('最多砍几次');
            $table->tinyInteger('status')->default(1)->comment('状态：1进行中，0关闭，2完成');
            $table->tinyInteger('del_flag')->default(0)->comment('删除状态：0正常，1关闭');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('bargain_orders');
    }
}
